//
//  HZZFLogging.h
//
//  Created by 早范 on 2025/7/12.
//  
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, HZZFLogLevel) {
    /// No logs
    HZZFLogLevelOff     = 0,
    /// Error logs only. 0...00001
    HZZFLogLevelError   = (1 << 0),
    /// Error and warning logs, 0...00010
    HZZFLogLevelWarning = (1 << 1),
    /// Error, warning and info logs, 0...00100
    HZZFLogLevelInfo    = (1 << 2),
    /// Error, warning, info and debug logs, 0...01000
    HZZFLogLevelDebug   = (1 << 3),
    /// Error, warning, info, debug and verbose logs, 0...10000
    HZZFLogLevelVerbose = (1 << 4),
    /// All logs. 1...11111
    HZZFLogLevelAll     = NSUIntegerMax
};

/// default is 'HZZFLogLevelInfo' if not set
HZZFLogLevel HZZFLogGetLevel(void);
void HZZFLogSetLevel(HZZFLogLevel level);

void _HZZFLogError(NSString *format, ...);
void _HZZFLogWarn(NSString *format, ...);
void _HZZFLogInfo(NSString *format, ...);
void _HZZFLogDebug(NSString *format, ...);
void _HZZFLogVerbose(NSString *format, ...);

#ifdef DEBUG
    #define HZZFLogError(...)   _HZZFLogError(__VA_ARGS__)
    #define HZZFLogWarn(...)    _HZZFLogWarn(__VA_ARGS__)
    #define HZZFLogInfo(...)    _HZZFLogInfo(__VA_ARGS__)
    #define HZZFLogDebug(...)   _HZZFLogDebug(__VA_ARGS__)
    #define HZZFLogVerbose(...) _HZZFLogVerbose(__VA_ARGS__)
#else
    #define HZZFLogError(...)   _HZZFLogError(__VA_ARGS__)
    #define HZZFLogWarn(...)    _HZZFLogWarn(__VA_ARGS__)
    #define HZZFLogInfo(...)    _HZZFLogInfo(__VA_ARGS__)
    #define HZZFLogDebug(...)   _HZZFLogDebug(__VA_ARGS__)
    #define HZZFLogVerbose(...) {}
#endif






